package com.colorful.insuranceproject.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.PrimaryKey;
import com.litesuits.orm.db.annotation.Table;
import com.litesuits.orm.db.enums.AssignType;

/**
 * 推送消息对象
 */
@Table("tab_push_msgs")
public class PushMessage implements Parcelable {

    public static final String COLUMN_TYPE_ID = "_type_id";
    public static final String COLUMN_ID = "_id";
    public static final String COLUMN_UID = "_uid";
    private static final String TYPE = "_type";
    private static final String MESSAGE_ID = "_message_id";
    private static final String APP_ID = "_app_id";
    private static final String TITLE = "_title";
    private static final String CONTEXT = "_text";
    private static final String TRACEINFO = "_traceinfo";
    private static final String TEXT = "_text";
    private static final String ISENOUGH = "_isEnough";
    private static final String KEKANGANPAY = "_keKangAnPay";
    private static final String OTHERPAY = "_otherpay";

    @Column(COLUMN_ID)
    @PrimaryKey(AssignType.AUTO_INCREMENT)
    private int id;

    /**
     * 消息拥有者id
     */
    @Column(COLUMN_UID)
    private String uid;


    /**
     *   数据类型的id
     */
    @Column(COLUMN_TYPE_ID)
    private String typeid;

    /**
     * 数据类型
     */
    @Column(TYPE)
    private int type;

    /**
     *  Message_ID
     */
    @Column(MESSAGE_ID)
    private String messageId;

    /**
     *  APP_ID
     */
    @Column(APP_ID)
    private String appId;

    /**
     *  TITLE
     */
    @Column(TITLE)
    private String title;

    /**
     *  CONTEXT
     */
    @Column(CONTEXT)
    private String content;

    /**
     *  TRACEINFO
     */
    @Column(TRACEINFO)
    private String traceInfo;

    /**
     *  Text
     */
    @Column(TEXT)
    private String text;

    /**
     *  isEnough
     */
    @Column(ISENOUGH)
    private boolean isEnough;

    /**
     *  KEKANGANPAY
     */
    @Column(KEKANGANPAY)
    private String keKangAnPay;

    /**
     *  OTHERPAY
     */
    @Column(OTHERPAY)
    private String otherPay;


    public PushMessage() {
    }

    public PushMessage(int id, String uid, String typeid, int type, String messageId, String appId, String title, String content, String traceInfo, String text, boolean isEnough, String keKangAnPay, String otherPay) {
        this.id = id;
        this.uid = uid;
        this.typeid = typeid;
        this.type = type;
        this.messageId = messageId;
        this.appId = appId;
        this.title = title;
        this.content = content;
        this.traceInfo = traceInfo;
        this.text = text;
        this.isEnough = isEnough;
        this.keKangAnPay = keKangAnPay;
        this.otherPay = otherPay;
    }

    public static String getColumnTypeId() {
        return COLUMN_TYPE_ID;
    }

    public static String getColumnId() {
        return COLUMN_ID;
    }

    public static String getColumnUid() {
        return COLUMN_UID;
    }

    public static String getTYPE() {
        return TYPE;
    }

    public static String getMessageId() {
        return MESSAGE_ID;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public static String getAppId() {
        return APP_ID;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTraceInfo() {
        return traceInfo;
    }

    public void setTraceInfo(String traceInfo) {
        this.traceInfo = traceInfo;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public boolean isEnough() {
        return isEnough;
    }

    public void setEnough(boolean enough) {
        isEnough = enough;
    }

    public String getKeKangAnPay() {
        return keKangAnPay;
    }

    public void setKeKangAnPay(String keKangAnPay) {
        this.keKangAnPay = keKangAnPay;
    }

    public String getOtherPay() {
        return otherPay;
    }

    public void setOtherPay(String otherPay) {
        this.otherPay = otherPay;
    }

    public static String getTITLE() {
        return TITLE;
    }

    public static String getCONTEXT() {
        return CONTEXT;
    }

    public static String getTRACEINFO() {
        return TRACEINFO;
    }

    public static String getTEXT() {
        return TEXT;
    }

    public static String getISENOUGH() {
        return ISENOUGH;
    }

    public static String getKEKANGANPAY() {
        return KEKANGANPAY;
    }

    public static String getOTHERPAY() {
        return OTHERPAY;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getTypeid() {
        return typeid;
    }

    public void setTypeid(String typeid) {
        this.typeid = typeid;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "PushMessage{" +
                "id=" + id +
                ", uid='" + uid + '\'' +
                ", typeid='" + typeid + '\'' +
                ", type=" + type +
                ", messageId='" + messageId + '\'' +
                ", appId='" + appId + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", traceInfo='" + traceInfo + '\'' +
                ", text='" + text + '\'' +
                ", isEnough=" + isEnough +
                ", keKangAnPay='" + keKangAnPay + '\'' +
                ", otherPay='" + otherPay + '\'' +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.uid);
        dest.writeString(this.typeid);
        dest.writeInt(this.type);
        dest.writeString(this.messageId);
        dest.writeString(this.appId);
        dest.writeString(this.title);
        dest.writeString(this.content);
        dest.writeString(this.traceInfo);
        dest.writeString(this.text);
        dest.writeByte(this.isEnough ? (byte) 1 : (byte) 0);
        dest.writeString(this.keKangAnPay);
        dest.writeString(this.otherPay);
    }

    protected PushMessage(Parcel in) {
        this.id = in.readInt();
        this.uid = in.readString();
        this.typeid = in.readString();
        this.type = in.readInt();
        this.messageId = in.readString();
        this.appId = in.readString();
        this.title = in.readString();
        this.content = in.readString();
        this.traceInfo = in.readString();
        this.text = in.readString();
        this.isEnough = in.readByte() != 0;
        this.keKangAnPay = in.readString();
        this.otherPay = in.readString();
    }

    public static final Creator<PushMessage> CREATOR = new Creator<PushMessage>() {
        @Override
        public PushMessage createFromParcel(Parcel source) {
            return new PushMessage(source);
        }

        @Override
        public PushMessage[] newArray(int size) {
            return new PushMessage[size];
        }
    };
}
